Try more decent appearance of calendar details separator. (#339540)
authorMathias Hasselmann <hasselmm@src.gnome.org>
Fri, 28 Dec 2007 09:36:57 +0000 (09:36 +0000)
committerMathias Hasselmann <hasselmm@src.gnome.org>
Fri, 28 Dec 2007 09:36:57 +0000 (09:36 +0000)
* gtk/gtkcalendar.c: Use different colors for drawing the separator,
and make it short by one pixel on each side.

svn path=/trunk/; revision=19266

ChangeLog
gtk/gtkcalendar.c

index ab7db389ba7b1dcd115976f9bb6544ee61f5f83f..e41f1e34ec8f7d813b29ba5da4adf25f050f6a72 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-12-28  Mathias Hasselmann  <mathias@openismus.com>
+
+       Try more decent appearance of calendar details separator. (#339540)
+
+       * gtk/gtkcalendar.c: Use different colors for drawing the separator,
+       and make it short by one pixel on each side.
+
 2007-12-28  Mathias Hasselmann  <mathias@openismus.com>
 
        Apply trivial code-style changes from attachement 101101. (#339540)
index 59452bbabd13ed75df26f3eb14d6b16bbb5025e8..29d2a7b49d40f74774abe10ee95136fa9b5b5026 100644 (file)
@@ -2473,11 +2473,22 @@ calendar_paint_day (GtkCalendar *calendar,
 
   if (priv->detail_func)
     {
+      cairo_save (cr);
+
+      if (calendar->selected_day == day)
+        gdk_cairo_set_source_color (cr, &widget->style->text[GTK_STATE_ACTIVE]);
+      else if (calendar->day_month[row][col] == MONTH_CURRENT)
+        gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_ACTIVE]);
+      else
+        gdk_cairo_set_source_color (cr, &widget->style->base[GTK_STATE_INSENSITIVE]);
+
       cairo_set_line_width (cr, 1);
-      cairo_move_to (cr, day_rect.x + 1, y_loc + 0.5);
-      cairo_line_to (cr, day_rect.x + day_rect.width - 1, y_loc + 0.5);
+      cairo_move_to (cr, day_rect.x + 2, y_loc + 0.5);
+      cairo_line_to (cr, day_rect.x + day_rect.width - 2, y_loc + 0.5);
       cairo_stroke (cr);
 
+      cairo_restore (cr);
+
       y_loc += 2;
     }